-- LuaEventLogger
-- Author: H.Humpel
-- DateStarted: 3/10/2022 8:58:18 PM
-- DateCreated: 12/03/2022 07:14:15 PM
--------------------------------------------------------------

--==================================================================================================================================================================
--======================================================================      VARIABLES       ======================================================================
--==================================================================================================================================================================

-- PrintValues: set to true so all values of the events are printed out; true or false; default: true
local PrintValues = true;

-- MaxTextHookLength: maximal width for the text of the Hook, without turn number and date information; default: 70
local MaxTextHookLength = 50;

--==================================================================================================================================================================
--====================================================================     CORE FUNCTIONS       ====================================================================
--==================================================================================================================================================================

function WriteToLuaLog(textHook, textValues)
	local timeString = os.date("[%Y-%m-%d %X]");
	local currentTurn = Game.GetCurrentGameTurn();
	local currentTurnOut = string.format("%3d", tonumber(currentTurn));

	local textHookLength = string.len(textHook);
	local textHookOut = "";
	local textHookFill = MaxTextHookLength-textHookLength;
	if textHookFill < 1 then
		textHookFill = 1;
	end

	local textValuesLength = string.len(textValues);

	for i=0,textHookFill,1 do
		textHookOut = "-"..textHookOut;
	end
	textHookOut = textHookOut .. " " .. textHook;
	print("----" .. textHookOut .. " called - (" .. currentTurnOut .. ") " .. timeString);

	if (PrintValues and (textValuesLength > 0)) then
		print("----- " .. textValues);
	end
end


--==================================================================================================================================================================
--==============================================================     FUNCTIONS CALLED BY HOOKS       ===============================================================
--==================================================================================================================================================================


--====== Events =====================================================================================================================================================


function OnAllianceAvailable(playerID, otherplayerID, AllianceType)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; otherplayerID: ' .. tostring(otherplayerID) .. '; AllianceType: ' .. tostring(AllianceType);
	WriteToLuaLog('Events.AllianceAvailable', sValues);
end

function OnAllianceEnded(playerID, otherplayerID, AllianceType)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; otherplayerID: ' .. tostring(otherplayerID) .. '; AllianceType: ' .. tostring(AllianceType);
	WriteToLuaLog('Events.AllianceEnded', sValues);
end

function OnAnarchyBegins()
	local sValues = '';
	WriteToLuaLog('Events.AnarchyBegins', sValues);
end

function OnAnarchyEnds()
	local sValues = '';
	WriteToLuaLog('Events.AnarchyEnds', sValues);
end

-- function OnBarbarianRaidStarted()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.BarbarianRaidStarted', sValues);
-- end

function OnBarbarianSpottedCity(playerID, unitID, cityOwner, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; cityOwner: ' .. tostring(cityOwner) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.BarbarianSpottedCity', sValues);
end

function OnBeginWonderReveal()
	local sValues = '';
	WriteToLuaLog('Events.BeginWonderReveal', sValues);
end

function OnBeliefAdded(playerID, beliefID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; beliefID: ' .. tostring(beliefID);
	WriteToLuaLog('Events.BeliefAdded', sValues);
end

function OnBuildingAddedToMap(iX, iY, buildingID, playerID, misc2, misc3)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; buildingID: ' .. tostring(buildingID) .. '; playerID: ' .. tostring(playerID) .. '; misc2: ' .. tostring(misc2) .. '; misc3: ' .. tostring(misc3);
	WriteToLuaLog('Events.BuildingAddedToMap', sValues);
end

-- function OnBuildingBuildProgressChanged()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.BuildingBuildProgressChanged', sValues);
-- end

function OnBuildingChanged(iX, iY, buildingID, playerID, iPercentComplete, iUnknown)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; buildingID: ' .. tostring(buildingID) .. '; playerID: ' .. tostring(playerID) .. '; iPercentComplete: ' .. tostring(iPercentComplete) .. '; iUnknown: ' .. tostring(iUnknown);
	WriteToLuaLog('Events.BuildingChanged', sValues);
end

-- function OnBuildingPillaged()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.BuildingPillaged', sValues);
-- end

function OnBuildingRemovedFromMap(iX, iY)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.BuildingRemovedFromMap', sValues);
end

-- function OnBuildingVisibilityChanged()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.BuildingVisibilityChanged', sValues);
-- end

-- function OnCacheUpdate()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.CacheUpdate', sValues);
-- end

-- function OnCameraUpdated(vFocusX, vFocusY, fZoomLevel)
-- 	local sValues = 'vFocusX: ' .. tostring(vFocusX) .. '; vFocusY: ' .. tostring(vFocusY) .. '; fZoomLevel: ' .. tostring(fZoomLevel);
-- 	WriteToLuaLog('Events.CameraUpdated', sValues);
-- end

function OnCapitalCityChanged(playerID, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CapitalCityChanged', sValues);
end

function OnCityAddedToMap(playerID, cityID, iX, iY)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.CityAddedToMap', sValues);
end

-- function OnCityChanged()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.CityChanged', sValues);
-- end

function OnCityCommandStarted(cityOwnerID, cityID, districtOwnerID, commandType, iData1)
	local sValues = 'cityOwnerID: ' .. tostring(cityOwnerID) .. '; cityID: ' .. tostring(cityID) .. '; districtOwnerID: ' .. tostring(districtOwnerID) .. '; commandType: ' .. tostring(commandType) .. '; iData1: ' .. tostring(iData1);
	WriteToLuaLog('Events.CityCommandStarted', sValues);
end

function OnCityDefenseStatusChanged(playerID, iValue)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; iValue: ' .. tostring(iValue);
	WriteToLuaLog('Events.CityDefenseStatusChanged', sValues);
end

function OnCityFocusChanged(playerID, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CityFocusChanged', sValues);
end

function OnCityInitialized(playerID, cityID, iX, iY)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.CityInitialized', sValues);
end

function OnCityLiberated(playerID, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CityLiberated', sValues);
end

function OnCityLoyaltyChanged(playerID, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CityLoyaltyChanged', sValues);
end

function OnCityMadePurchase(playerID, cityID, iX, iY, purchaseType, objectType)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; purchaseType: ' .. tostring(purchaseType) .. '; objectType: ' .. tostring(objectType);
	WriteToLuaLog('Events.CityMadePurchase', sValues);
end

function OnCityNameChanged(playerID, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CityNameChanged', sValues);
end

function OnCityOccupationChanged(playerID, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CityOccupationChanged', sValues);
end

function OnCityPopulationChanged(playerID, cityID, cityPopulation)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; cityPopulation: ' .. tostring(cityPopulation);
	WriteToLuaLog('Events.CityPopulationChanged', sValues);
end

function OnCityProductionChanged(playerID, cityID, productionID, objectID, bCancelled)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; productionID: ' .. tostring(productionID) .. '; objectID: ' .. tostring(objectID) .. '; bCancelled: ' .. tostring(bCancelled);
	WriteToLuaLog('Events.CityProductionChanged', sValues);
end

function OnCityProductionCompleted(playerID, cityID, iConstructionType, unitID, bCancelled)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; iConstructionType: ' .. tostring(iConstructionType) .. '; unitID: ' .. tostring(unitID) .. '; bCancelled: ' .. tostring(bCancelled);
	WriteToLuaLog('Events.CityProductionCompleted', sValues);
end

function OnCityProductionUpdated(playerID, cityID, objectID, productionID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; objectID: ' .. tostring(objectID) .. '; productionID: ' .. tostring(productionID);
	WriteToLuaLog('Events.CityProductionUpdated', sValues);
end

function OnCityProjectCompleted(playerID, cityID, projectID, buildingIndex, iX, iY, bCancelled)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; projectID: ' .. tostring(projectID) .. '; buildingIndex: ' .. tostring(buildingIndex) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; bCancelled: ' .. tostring(bCancelled);
	WriteToLuaLog('Events.CityProjectCompleted', sValues);
end

function OnCityReligionChanged(playerID, cityID, eVisibility, city)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; eVisibility: ' .. tostring(eVisibility) .. '; city: ' .. tostring(city);
	WriteToLuaLog('Events.CityReligionChanged', sValues);
end

function OnCityReligionFollowersChanged(playerID, cityID, eVisibility, city)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; eVisibility: ' .. tostring(eVisibility) .. '; city: ' .. tostring(city);
	WriteToLuaLog('Events.CityReligionFollowersChanged', sValues);
end

function OnCityRemovedFromMap(playerID, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CityRemovedFromMap', sValues);
end

function OnCitySiegeStatusChanged(playerID, cityID, bIsBesieged)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; bIsBesieged: ' .. tostring(bIsBesieged);
	WriteToLuaLog('Events.CitySiegeStatusChanged', sValues);
end

function OnCityTileOwnershipChanged(owner, cityID)
	local sValues = 'owner: ' .. tostring(owner) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CityTileOwnershipChanged', sValues);
end

function OnCityTransfered(playerID, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CityTransfered', sValues);
end

function OnCityUnitsChanged(playerID, cityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID);
	WriteToLuaLog('Events.CityUnitsChanged', sValues);
end

function OnCityVisibilityChanged(playerID, cityID, eVisibility)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; eVisibility: ' .. tostring(eVisibility);
	WriteToLuaLog('Events.CityVisibilityChanged', sValues);
end

function OnCityWorkerChanged(ownerPlayerID, cityID, iX, iY)
	local sValues = 'ownerPlayerID: ' .. tostring(ownerPlayerID) .. '; cityID: ' .. tostring(cityID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.CityWorkerChanged', sValues);
end

function OnCivicBoostTriggered(playerID, iBoostedCivic, iUnknownA, iUnknownB)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; iBoostedCivic: ' .. tostring(iBoostedCivic) .. '; iUnknownA: ' .. tostring(iUnknownA) .. '; iUnknownB: ' .. tostring(iUnknownB);
	WriteToLuaLog('Events.CivicBoostTriggered', sValues);
end

function OnCivicChanged(ePlayer, eCivic)
	local sValues = 'ePlayer: ' .. tostring(ePlayer) .. '; eCivic: ' .. tostring(eCivic);
	WriteToLuaLog('Events.CivicChanged', sValues);
end

function OnCivicCompleted(playerID, iCivic, bCancelled)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; iCivic: ' .. tostring(iCivic) .. '; bCancelled: ' .. tostring(bCancelled);
	WriteToLuaLog('Events.CivicCompleted', sValues);
end

function OnCivicQueueChanged()
	local sValues = '';
	WriteToLuaLog('Events.CivicQueueChanged', sValues);
end

function OnCivicsUnlocked()
	local sValues = '';
	WriteToLuaLog('Events.CivicsUnlocked', sValues);
end

-- function OnCliffAddedToMap()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.CliffAddedToMap', sValues);
-- end

-- function OnCliffRemovedFromMap()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.CliffRemovedFromMap', sValues);
-- end

function OnCombat(combatResult)
	local sValues = 'combatResult: ' .. tostring(combatResult);
	WriteToLuaLog('Events.Combat', sValues);
end

function OnCulturalIdentityCitizenConverted()
	local sValues = '';
	WriteToLuaLog('Events.CulturalIdentityCitizenConverted', sValues);
end

function OnCulturalIdentityCityConverted(player, cityID, fromPlayer)
	local sValues = 'player: ' .. tostring(player) .. '; cityID: ' .. tostring(cityID) .. '; fromPlayer: ' .. tostring(fromPlayer);
	WriteToLuaLog('Events.CulturalIdentityCityConverted', sValues);
end

function OnCulturalIdentityConversionOutcomeChanged(player, cityID, eOutcome)
	local sValues = 'player: ' .. tostring(player) .. '; cityID: ' .. tostring(cityID) .. '; eOutcome: ' .. tostring(eOutcome);
	WriteToLuaLog('Events.CulturalIdentityConversionOutcomeChanged', sValues);
end

function OnCultureChanged()
	local sValues = '';
	WriteToLuaLog('Events.CultureChanged', sValues);
end

function OnCultureYieldChanged(ePlayer)
	local sValues = 'ePlayer: ' .. tostring(ePlayer);
	WriteToLuaLog('Events.CultureYieldChanged', sValues);
end

function OnDiplomacyDealEnacted()
	local sValues = '';
	WriteToLuaLog('Events.DiplomacyDealEnacted', sValues);
end

function OnDiplomacyDealExpired()
	local sValues = '';
	WriteToLuaLog('Events.DiplomacyDealExpired', sValues);
end

function OnDiplomacyDeclareWar(firstPlayerID, secondPlayerID)
	local sValues = 'firstPlayerID: ' .. tostring(firstPlayerID) .. '; secondPlayerID: ' .. tostring(secondPlayerID);
	WriteToLuaLog('Events.DiplomacyDeclareWar', sValues);
end

function OnDiplomacyIncomingDeal(eFromPlayer, eToPlayer, eAction)
	local sValues = 'eFromPlayer: ' .. tostring(eFromPlayer) .. '; eToPlayer: ' .. tostring(eToPlayer) .. '; eAction: ' .. tostring(eAction);
	WriteToLuaLog('Events.DiplomacyIncomingDeal', sValues);
end

function OnDiplomacyMakePeace(firstPlayerID, secondPlayerID)
	local sValues = 'firstPlayerID: ' .. tostring(firstPlayerID) .. '; secondPlayerID: ' .. tostring(secondPlayerID);
	WriteToLuaLog('Events.DiplomacyMakePeace', sValues);
end

function OnDiplomacyMeet(player1ID, player2ID)
	local sValues = 'player1ID: ' .. tostring(player1ID) .. '; player2ID: ' .. tostring(player2ID);
	WriteToLuaLog('Events.DiplomacyMeet', sValues);
end

function OnDiplomacyMeetMajorMinor()
	local sValues = '';
	WriteToLuaLog('Events.DiplomacyMeetMajorMinor', sValues);
end

function OnDiplomacyMeetMajors()
	local sValues = '';
	WriteToLuaLog('Events.DiplomacyMeetMajors', sValues);
end

function OnDiplomacyRefusePeace(eActingPlayer, eReactingPlayer)
	local sValues = 'eActingPlayer: ' .. tostring(eActingPlayer) .. '; eReactingPlayer: ' .. tostring(eReactingPlayer);
	WriteToLuaLog('Events.DiplomacyRefusePeace', sValues);
end

function OnDiplomacyRelationshipChanged(player1ID, player2ID)
	local sValues = 'player1ID: ' .. tostring(player1ID) .. '; player2ID: ' .. tostring(player2ID);
	WriteToLuaLog('Events.DiplomacyRelationshipChanged', sValues);
end

function OnDiplomacySessionClosed(sessionID)
	local sValues = 'sessionID: ' .. tostring(sessionID);
	WriteToLuaLog('Events.DiplomacySessionClosed', sValues);
end

function OnDiplomacyStatement(eActingPlayer, eReactingPlayer, values)
	local sValues = 'eActingPlayer: ' .. tostring(eActingPlayer) .. '; eReactingPlayer: ' .. tostring(eReactingPlayer) .. '; values: ' .. tostring(values);
	WriteToLuaLog('Events.DiplomacyStatement', sValues);
end

function OnDistrictAddedToMap(playerID, districtID, cityID, iX, iY, districtType, percentComplete)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; districtID: ' .. tostring(districtID) .. '; cityID: ' .. tostring(cityID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; districtType: ' .. tostring(districtType) .. '; percentComplete: ' .. tostring(percentComplete);
	WriteToLuaLog('Events.DistrictAddedToMap', sValues);
end

-- function OnDistrictBuildingRestore()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.DistrictBuildingRestore', sValues);
-- end

function OnDistrictBuildProgressChanged(playerID, districtID, cityID, iX, iY, districtType, era, civilization, percentComplete, iAppeal, isPillaged)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; districtID: ' .. tostring(districtID) .. '; cityID: ' .. tostring(cityID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; districtType: ' .. tostring(districtType) .. '; era: ' .. tostring(era) .. '; civilization: ' .. tostring(civilization) .. '; percentComplete: ' .. tostring(percentComplete) .. '; iAppeal: ' .. tostring(iAppeal) .. '; isPillaged: ' .. tostring(isPillaged);
	WriteToLuaLog('Events.DistrictBuildProgressChanged', sValues);
end

function OnDistrictCombatChanged(eventSubType, playerID, districtID)
	local sValues = 'eventSubType: ' .. tostring(eventSubType) .. '; playerID: ' .. tostring(playerID) .. '; districtID: ' .. tostring(districtID);
	WriteToLuaLog('Events.DistrictCombatChanged', sValues);
end

function OnDistrictDamageChanged(playerID, districtID, damageType, newDamage, oldDamage)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; districtID: ' .. tostring(districtID) .. '; damageType: ' .. tostring(damageType) .. '; newDamage: ' .. tostring(newDamage) .. '; oldDamage: ' .. tostring(oldDamage);
	WriteToLuaLog('Events.DistrictDamageChanged', sValues);
end

function OnDistrictPillaged(owner, districtID, cityID, iX, iY, districtType, percentComplete, isPillaged)
	local sValues = 'owner: ' .. tostring(owner) .. '; districtID: ' .. tostring(districtID) .. '; cityID: ' .. tostring(cityID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; districtType: ' .. tostring(districtType) .. '; percentComplete: ' .. tostring(percentComplete) .. '; isPillaged: ' .. tostring(isPillaged);
	WriteToLuaLog('Events.DistrictPillaged', sValues);
end

function OnDistrictRemovedFromMap(playerID, districtID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; districtID: ' .. tostring(districtID);
	WriteToLuaLog('Events.DistrictRemovedFromMap', sValues);
end

function OnDistrictUnitsChanged(playerID, districtID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; districtID: ' .. tostring(districtID);
	WriteToLuaLog('Events.DistrictUnitsChanged', sValues);
end

function OnDistrictVisibilityChanged(playerID, districtID, eVisibility)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; districtID: ' .. tostring(districtID) .. '; eVisibility: ' .. tostring(eVisibility);
	WriteToLuaLog('Events.DistrictVisibilityChanged', sValues);
end

function OnEmergenciesUpdated()
	local sValues = '';
	WriteToLuaLog('Events.EmergenciesUpdated', sValues);
end

function OnEmergencyAvailable(playerTarget, emergencyType)
	local sValues = 'playerTarget: ' .. tostring(playerTarget) .. '; emergencyType: ' .. tostring(emergencyType);
	WriteToLuaLog('Events.EmergencyAvailable', sValues);
end

function OnEmergencyAvailableParticipant()
	local sValues = '';
	WriteToLuaLog('Events.EmergencyAvailableParticipant', sValues);
end

function OnEmergencyCompleted(playerID, eTargetPlayer, iTurn)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; eTargetPlayer: ' .. tostring(eTargetPlayer) .. '; iTurn: ' .. tostring(iTurn);
	WriteToLuaLog('Events.EmergencyCompleted', sValues);
end

function OnEmergencyCompleteParticipants()
	local sValues = '';
	WriteToLuaLog('Events.EmergencyCompleteParticipants', sValues);
end

function OnEmergencyRejected()
	local sValues = '';
	WriteToLuaLog('Events.EmergencyRejected', sValues);
end

function OnEmergencyStarted(playerID, eTargetPlayer, iTurn)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; eTargetPlayer: ' .. tostring(eTargetPlayer) .. '; iTurn: ' .. tostring(iTurn);
	WriteToLuaLog('Events.EmergencyStarted', sValues);
end

function OnEndTurnBlockingChanged(ePrevEndTurnBlockingType, eNewEndTurnBlockingType)
	local sValues = 'ePrevEndTurnBlockingType: ' .. tostring(ePrevEndTurnBlockingType) .. '; eNewEndTurnBlockingType: ' .. tostring(eNewEndTurnBlockingType);
	WriteToLuaLog('Events.EndTurnBlockingChanged', sValues);
end

function OnEndTurnDirty()
	local sValues = '';
	WriteToLuaLog('Events.EndTurnDirty', sValues);
end

function OnEndWonderReveal()
	local sValues = '';
	WriteToLuaLog('Events.EndWonderReveal', sValues);
end

function OnEventPopupRequest()
	local sValues = '';
	WriteToLuaLog('Events.EventPopupRequest', sValues);
end

function OnEventSoundRequest()
	local sValues = '';
	WriteToLuaLog('Events.EventSoundRequest', sValues);
end

function OnFaithChanged(playerID, yield, balance)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; yield: ' .. tostring(yield) .. '; balance: ' .. tostring(balance);
	WriteToLuaLog('Events.FaithChanged', sValues);
end

function OnFeatureAddedToMap()
	local sValues = '';
	WriteToLuaLog('Events.FeatureAddedToMap', sValues);
end

function OnFeatureChanged()
	local sValues = '';
	WriteToLuaLog('Events.FeatureChanged', sValues);
end

function OnFeatureRemovedFromMap()
	local sValues = '';
	WriteToLuaLog('Events.FeatureRemovedFromMap', sValues);
end

-- function OnFeatureVisibilityChanged()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.FeatureVisibilityChanged', sValues);
-- end

function OnGameEraChanged(previousEra, newEra)
	local sValues = 'previousEra: ' .. tostring(previousEra) .. '; newEra: ' .. tostring(newEra);
	WriteToLuaLog('Events.GameEraChanged', sValues);
end

function OnGameHistoryMomentRecorded(momentIndex, iUnknown)
	local sValues = 'momentIndex: ' .. tostring(momentIndex) .. '; iUnknown: ' .. tostring(iUnknown);
	WriteToLuaLog('Events.GameHistoryMomentRecorded', sValues);
end

function OnGoodyHutReward(playerID, unitID, iUnknown1, iUnknown2)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; iUnknown1: ' .. tostring(iUnknown1) .. '; iUnknown2: ' .. tostring(iUnknown2);
	WriteToLuaLog('Events.GoodyHutReward', sValues);
end

function OnGovDistrictPolicyLocked()
	local sValues = '';
	WriteToLuaLog('Events.GovDistrictPolicyLocked', sValues);
end

function OnGovDistrictPolicyUnlocked(player, policyType)
	local sValues = 'player: ' .. tostring(player) .. '; policyType: ' .. tostring(policyType);
	WriteToLuaLog('Events.GovDistrictPolicyUnlocked', sValues);
end

function OnGovernmentChanged(playerID, governmentID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; governmentID: ' .. tostring(governmentID);
	WriteToLuaLog('Events.GovernmentChanged', sValues);
end

function OnGovernmentPolicyChanged(playerID, policyID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; policyID: ' .. tostring(policyID);
	WriteToLuaLog('Events.GovernmentPolicyChanged', sValues);
end

function OnGovernmentPolicyObsoleted(ePlayer)
	local sValues = 'ePlayer: ' .. tostring(ePlayer);
	WriteToLuaLog('Events.GovernmentPolicyObsoleted', sValues);
end

function OnGovernorAppointed(playerID, governorID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; governorID: ' .. tostring(governorID);
	WriteToLuaLog('Events.GovernorAppointed', sValues);
end

function OnGovernorAssigned(cityOwner, cityID, governorOwner, governorType)
	local sValues = 'cityOwner: ' .. tostring(cityOwner) .. '; cityID: ' .. tostring(cityID) .. '; governorOwner: ' .. tostring(governorOwner) .. '; governorType: ' .. tostring(governorType);
	WriteToLuaLog('Events.GovernorAssigned', sValues);
end

function OnGovernorChanged(playerID, governorID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; governorID: ' .. tostring(governorID);
	WriteToLuaLog('Events.GovernorChanged', sValues);
end

function OnGovernorEstablished()
	local sValues = '';
	WriteToLuaLog('Events.GovernorEstablished', sValues);
end

function OnGovernorPointsChanged(player, iDelta)
	local sValues = 'player: ' .. tostring(player) .. '; iDelta: ' .. tostring(iDelta);
	WriteToLuaLog('Events.GovernorPointsChanged', sValues);
end

function OnGovernorPromoted(ePlayer, eGovernor, ePromotion)
	local sValues = 'ePlayer: ' .. tostring(ePlayer) .. '; eGovernor: ' .. tostring(eGovernor) .. '; ePromotion: ' .. tostring(ePromotion);
	WriteToLuaLog('Events.GovernorPromoted', sValues);
end

function OnGreatPeoplePointsChanged(playerID)
	local sValues = 'playerID: ' .. tostring(playerID);
	WriteToLuaLog('Events.GreatPeoplePointsChanged', sValues);
end

function OnGreatPeopleTimelineChanged()
	local sValues = '';
	WriteToLuaLog('Events.GreatPeopleTimelineChanged', sValues);
end

function OnGreatWorkCreated(playerID, unitID, iCityPlotX, iCityPlotY, buildingID, greatWorkID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; iCityPlotX: ' .. tostring(iCityPlotX) .. '; iCityPlotY: ' .. tostring(iCityPlotY) .. '; buildingID: ' .. tostring(buildingID) .. '; greatWorkID: ' .. tostring(greatWorkID);
	WriteToLuaLog('Events.GreatWorkCreated', sValues);
end

function OnGreatWorkMoved(fromCityOwner, fromCityID, toCityOwner, toCityID, buildingID, greatWorkType)
	local sValues = 'fromCityOwner: ' .. tostring(fromCityOwner) .. '; fromCityID: ' .. tostring(fromCityID) .. '; toCityOwner: ' .. tostring(toCityOwner) .. '; toCityID: ' .. tostring(toCityID) .. '; buildingID: ' .. tostring(buildingID) .. '; greatWorkType: ' .. tostring(greatWorkType);
	WriteToLuaLog('Events.GreatWorkMoved', sValues);
end

function OnImprovementActivated(iX, iY, unitOwner, unitID, improvementType, improvementOwner, activationType)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; unitOwner: ' .. tostring(unitOwner) .. '; unitID: ' .. tostring(unitID) .. '; improvementType: ' .. tostring(improvementType) .. '; improvementOwner: ' .. tostring(improvementOwner) .. '; activationType: ' .. tostring(activationType);
	WriteToLuaLog('Events.ImprovementActivated', sValues);
end

function OnImprovementAddedToMap(iX, iY, eImprovement, playerID)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; eImprovement: ' .. tostring(eImprovement) .. '; playerID: ' .. tostring(playerID);
	WriteToLuaLog('Events.ImprovementAddedToMap', sValues);
end

function OnImprovementChanged(iX, iY, improvementType, improvementOwner, resource, isPillaged, isWorked)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; improvementType: ' .. tostring(improvementType) .. '; improvementOwner: ' .. tostring(improvementOwner) .. '; resource: ' .. tostring(resource) .. '; isPillaged: ' .. tostring(isPillaged) .. '; isWorked: ' .. tostring(isWorked);
	WriteToLuaLog('Events.ImprovementChanged', sValues);
end

function OnImprovementOwnershipChanged()
	local sValues = '';
	WriteToLuaLog('Events.ImprovementOwnershipChanged', sValues);
end

function OnImprovementRemovedFromMap(iX, iY, eOwner)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; eOwner: ' .. tostring(eOwner);
	WriteToLuaLog('Events.ImprovementRemovedFromMap', sValues);
end

function OnImprovementVisibilityChanged(iX, iY, eImprovementType, eVisibility)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; eImprovementType: ' .. tostring(eImprovementType) .. '; eVisibility: ' .. tostring(eVisibility);
	WriteToLuaLog('Events.ImprovementVisibilityChanged', sValues);
end

function OnInfluenceChanged()
	local sValues = '';
	WriteToLuaLog('Events.InfluenceChanged', sValues);
end

function OnInfluenceGiven(citystateID, playerID)
	local sValues = 'citystateID: ' .. tostring(citystateID) .. '; playerID: ' .. tostring(playerID);
	WriteToLuaLog('Events.InfluenceGiven', sValues);
end

function OnLevyCounterChanged(originalOwnerID)
	local sValues = 'originalOwnerID: ' .. tostring(originalOwnerID);
	WriteToLuaLog('Events.LevyCounterChanged', sValues);
end

function OnLocalPlayerChanged(localPlayerID, prevLocalPlayerID)
	local sValues = 'localPlayerID: ' .. tostring(localPlayerID) .. '; prevLocalPlayerID: ' .. tostring(prevLocalPlayerID);
	WriteToLuaLog('Events.LocalPlayerChanged', sValues);
end

function OnLocalPlayerTurnBegin()
	local sValues = '';
	WriteToLuaLog('Events.LocalPlayerTurnBegin', sValues);
end

function OnLocalPlayerTurnEnd()
	local sValues = '';
	WriteToLuaLog('Events.LocalPlayerTurnEnd', sValues);
end

function OnLocalPlayerTurnUnready()
	local sValues = '';
	WriteToLuaLog('Events.LocalPlayerTurnUnready', sValues);
end

function OnMapYieldsChanged()
	local sValues = '';
	WriteToLuaLog('Events.MapYieldsChanged', sValues);
end

function OnNationalParkAdded()
	local sValues = '';
	WriteToLuaLog('Events.NationalParkAdded', sValues);
end

function OnNationalParkRemoved()
	local sValues = '';
	WriteToLuaLog('Events.NationalParkRemoved', sValues);
end

-- function OnNationalParkVisibilityChanged()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.NationalParkVisibilityChanged', sValues);
-- end

function OnNaturalWonderRevealed(iX, iY, eFeature, bIsFirstToFind)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; eFeature: ' .. tostring(eFeature) .. '; bIsFirstToFind: ' .. tostring(bIsFirstToFind);
	WriteToLuaLog('Events.NaturalWonderRevealed', sValues);
end

function OnNotificationActivated(playerID, notificationID, bActivatedByUser)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; notificationID: ' .. tostring(notificationID) .. '; bActivatedByUser: ' .. tostring(bActivatedByUser);
	WriteToLuaLog('Events.NotificationActivated', sValues);
end

function OnNotificationAdded(playerID, notificationID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; notificationID: ' .. tostring(notificationID);
	WriteToLuaLog('Events.NotificationAdded', sValues);
end

function OnNotificationDismissed(playerID, notificationID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; notificationID: ' .. tostring(notificationID);
	WriteToLuaLog('Events.NotificationDismissed', sValues);
end

function OnNotificationRefreshRequested()
	local sValues = '';
	WriteToLuaLog('Events.NotificationRefreshRequested', sValues);
end

function OnObjectPairing(eSubType, parentOwner, parentType, parentID, childOwner, childType, childID)
	local sValues = 'eSubType: ' .. tostring(eSubType) .. '; parentOwner: ' .. tostring(parentOwner) .. '; parentType: ' .. tostring(parentType) .. '; parentID: ' .. tostring(parentID) .. '; childOwner: ' .. tostring(childOwner) .. '; childType: ' .. tostring(childType) .. '; childID: ' .. tostring(childID);
	WriteToLuaLog('Events.ObjectPairing', sValues);
end

function OnOnAiAdvisorUpdated()
	local sValues = '';
	WriteToLuaLog('Events.OnAiAdvisorUpdated', sValues);
end

function OnUnitGreatPersonActivated(unitOwner, unitID, greatPersonClassID, greatPersonIndividualID, unitOwner, unitID, greatPersonClassID, greatPersonIndividualID)
	local sValues = 'unitOwner: ' .. tostring(unitOwner) .. '; unitID: ' .. tostring(unitID) .. '; greatPersonClassID: ' .. tostring(greatPersonClassID) .. '; greatPersonIndividualID: ' .. tostring(greatPersonIndividualID) .. '; unitOwner: ' .. tostring(unitOwner) .. '; unitID: ' .. tostring(unitID) .. '; greatPersonClassID: ' .. tostring(greatPersonClassID) .. '; greatPersonIndividualID: ' .. tostring(greatPersonIndividualID);
	WriteToLuaLog('Events.UnitGreatPersonActivated', sValues);
end

function OnPantheonFounded(ePlayer)
	local sValues = 'ePlayer: ' .. tostring(ePlayer);
	WriteToLuaLog('Events.PantheonFounded', sValues);
end

function OnPhaseBegin()
	local sValues = '';
	WriteToLuaLog('Events.PhaseBegin', sValues);
end

function OnPhaseEnd()
	local sValues = '';
	WriteToLuaLog('Events.PhaseEnd', sValues);
end

function OnPlayerAgeChanged(playerID)
	local sValues = 'playerID: ' .. tostring(playerID);
	WriteToLuaLog('Events.PlayerAgeChanged', sValues);
end

function OnPlayerBordersChanged()
	local sValues = '';
	WriteToLuaLog('Events.PlayerBordersChanged', sValues);
end

function OnPlayerDarkAgeChanged(playerID)
	local sValues = 'playerID: ' .. tostring(playerID);
	WriteToLuaLog('Events.PlayerDarkAgeChanged', sValues);
end

function OnPlayerDefeat(playerID, defeatType, eventID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; defeatType: ' .. tostring(defeatType) .. '; eventID: ' .. tostring(eventID);
	WriteToLuaLog('Events.PlayerDefeat', sValues);
end

function OnPlayerDestroyed()
	local sValues = '';
	WriteToLuaLog('Events.PlayerDestroyed', sValues);
end

function OnPlayerEraChanged(playerID, eraID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; eraID: ' .. tostring(eraID);
	WriteToLuaLog('Events.PlayerEraChanged', sValues);
end

function OnPlayerEraScoreChanged(playerID, amountAwarded)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; amountAwarded: ' .. tostring(amountAwarded);
	WriteToLuaLog('Events.PlayerEraScoreChanged', sValues);
end

function OnPlayerEraTransitionBegins(playerID)
	local sValues = 'playerID: ' .. tostring(playerID);
	WriteToLuaLog('Events.PlayerEraTransitionBegins', sValues);
end

function OnPlayerOperationComplete()
	local sValues = '';
	WriteToLuaLog('Events.PlayerOperationComplete', sValues);
end

function OnPlayerResourceChanged(ownerPlayerID, resourceTypeID)
	local sValues = 'ownerPlayerID: ' .. tostring(ownerPlayerID) .. '; resourceTypeID: ' .. tostring(resourceTypeID);
	WriteToLuaLog('Events.PlayerResourceChanged', sValues);
end

function OnPlayerRestored()
	local sValues = '';
	WriteToLuaLog('Events.PlayerRestored', sValues);
end

function OnPlayerRevived()
	local sValues = '';
	WriteToLuaLog('Events.PlayerRevived', sValues);
end

function OnPlayerTurnActivated(playerID, bIsFirstTime)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; bIsFirstTime: ' .. tostring(bIsFirstTime);
	WriteToLuaLog('Events.PlayerTurnActivated', sValues);
end

function OnPlayerTurnDeactivated(playerID)
	local sValues = 'playerID: ' .. tostring(playerID);
	WriteToLuaLog('Events.PlayerTurnDeactivated', sValues);
end

-- function OnPlayerVictory()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.PlayerVictory', sValues);
-- end

-- function OnPlotAppealChanged()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.PlotAppealChanged', sValues);
-- end

function OnPlotMarkerChanged(iX, iY)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.PlotMarkerChanged', sValues);
end

function OnPlotVisibilityChanged(iX, iY, visibilityType)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; visibilityType: ' .. tostring(visibilityType);
	WriteToLuaLog('Events.PlotVisibilityChanged', sValues);
end

function OnPlotYieldChanged(iX, iY)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.PlotYieldChanged', sValues);
end

function OnQuestChanged(CityStateID, CompletedQuestPlayerID)
	local sValues = 'CityStateID: ' .. tostring(CityStateID) .. '; CompletedQuestPlayerID: ' .. tostring(CompletedQuestPlayerID);
	WriteToLuaLog('Events.QuestChanged', sValues);
end

-- function OnQueueFlushed()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.QueueFlushed', sValues);
-- end

function OnReligionFounded(playerID, religionID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; religionID: ' .. tostring(religionID);
	WriteToLuaLog('Events.ReligionFounded', sValues);
end

function OnRemotePlayerTurnBegin()
	local sValues = '';
	WriteToLuaLog('Events.RemotePlayerTurnBegin', sValues);
end

function OnRemotePlayerTurnEnd()
	local sValues = '';
	WriteToLuaLog('Events.RemotePlayerTurnEnd', sValues);
end

function OnRemotePlayerTurnUnready()
	local sValues = '';
	WriteToLuaLog('Events.RemotePlayerTurnUnready', sValues);
end

function OnResearchChanged(ePlayer, eTech)
	local sValues = 'ePlayer: ' .. tostring(ePlayer) .. '; eTech: ' .. tostring(eTech);
	WriteToLuaLog('Events.ResearchChanged', sValues);
end

function OnResearchCompleted(ePlayer, eTech)
	local sValues = 'ePlayer: ' .. tostring(ePlayer) .. '; eTech: ' .. tostring(eTech);
	WriteToLuaLog('Events.ResearchCompleted', sValues);
end

function OnResearchQueueChanged(ePlayer, eTech)
	local sValues = 'ePlayer: ' .. tostring(ePlayer) .. '; eTech: ' .. tostring(eTech);
	WriteToLuaLog('Events.ResearchQueueChanged', sValues);
end

function OnResearchYieldChanged(ePlayer)
	local sValues = 'ePlayer: ' .. tostring(ePlayer);
	WriteToLuaLog('Events.ResearchYieldChanged', sValues);
end

function OnResourceAddedToMap(iX, iY, resourceType)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; resourceType: ' .. tostring(resourceType);
	WriteToLuaLog('Events.ResourceAddedToMap', sValues);
end

function OnResourceChanged()
	local sValues = '';
	WriteToLuaLog('Events.ResourceChanged', sValues);
end

function OnResourceRemovedFromMap(iX, iY, resourceType)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; resourceType: ' .. tostring(resourceType);
	WriteToLuaLog('Events.ResourceRemovedFromMap', sValues);
end

function OnResourceVisibilityChanged(iX, iY, resourceType, visibilityType)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; resourceType: ' .. tostring(resourceType) .. '; visibilityType: ' .. tostring(visibilityType);
	WriteToLuaLog('Events.ResourceVisibilityChanged', sValues);
end

-- function OnRiverAddedToMap()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.RiverAddedToMap', sValues);
-- end

-- function OnRiverRemovedFromMap()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.RiverRemovedFromMap', sValues);
-- end

function OnRouteAddedToMap()
	local sValues = '';
	WriteToLuaLog('Events.RouteAddedToMap', sValues);
end

function OnRouteChanged(iX, iY)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.RouteChanged', sValues);
end

function OnRouteRemovedFromMap()
	local sValues = '';
	WriteToLuaLog('Events.RouteRemovedFromMap', sValues);
end

-- function OnRouteVisibilityChanged()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.RouteVisibilityChanged', sValues);
-- end

function OnSpyAdded(spyOwner, spyUnitID)
	local sValues = 'spyOwner: ' .. tostring(spyOwner) .. '; spyUnitID: ' .. tostring(spyUnitID);
	WriteToLuaLog('Events.SpyAdded', sValues);
end

function OnSpyMissionCompleted(playerID, missionID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; missionID: ' .. tostring(missionID);
	WriteToLuaLog('Events.SpyMissionCompleted', sValues);
end

function OnSpyMissionUpdated()
	local sValues = '';
	WriteToLuaLog('Events.SpyMissionUpdated', sValues);
end

function OnSpyRemoved(spyOwner, counterSpyPlayer)
	local sValues = 'spyOwner: ' .. tostring(spyOwner) .. '; counterSpyPlayer: ' .. tostring(counterSpyPlayer);
	WriteToLuaLog('Events.SpyRemoved', sValues);
end

function OnSpyUpdated()
	local sValues = '';
	WriteToLuaLog('Events.SpyUpdated', sValues);
end

function OnStatusMessage()
	local sValues = '';
	WriteToLuaLog('Events.StatusMessage', sValues);
end

function OnSystemUpdateUI(type, tag, iData1, iData2, strData1)
	local sValues = 'type: ' .. tostring(type) .. '; tag: ' .. tostring(tag) .. '; iData1: ' .. tostring(iData1) .. '; iData2: ' .. tostring(iData2) .. '; strData1: ' .. tostring(strData1);
	WriteToLuaLog('Events.SystemUpdateUI', sValues);
end

function OnTeamVictory()
	local sValues = '';
	WriteToLuaLog('Events.TeamVictory', sValues);
end

function OnTechBoostTriggered(playerID, iTechBoosted, iUnknownA, iUnknownB)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; iTechBoosted: ' .. tostring(iTechBoosted) .. '; iUnknownA: ' .. tostring(iUnknownA) .. '; iUnknownB: ' .. tostring(iUnknownB);
	WriteToLuaLog('Events.TechBoostTriggered', sValues);
end

function OnTerrainTypeChanged()
	local sValues = '';
	WriteToLuaLog('Events.TerrainTypeChanged', sValues);
end

function OnTradeRouteActivityChanged(playerID, OriginPlayerID, OriginCityID, TargetPlayerID, TargetCityID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; OriginPlayerID: ' .. tostring(OriginPlayerID) .. '; OriginCityID: ' .. tostring(OriginCityID) .. '; TargetPlayerID: ' .. tostring(TargetPlayerID) .. '; TargetCityID: ' .. tostring(TargetCityID);
	WriteToLuaLog('Events.TradeRouteActivityChanged', sValues);
end

function OnTradeRouteAddedToMap(playerID, iX, iY)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.TradeRouteAddedToMap', sValues);
end

function OnTradeRouteCapacityChanged(playerID)
	local sValues = 'playerID: ' .. tostring(playerID);
	WriteToLuaLog('Events.TradeRouteCapacityChanged', sValues);
end

function OnTradeRouteRangeChanged()
	local sValues = '';
	WriteToLuaLog('Events.TradeRouteRangeChanged', sValues);
end

function OnTradeRouteRemovedFromMap(playerID, iX, iY)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.TradeRouteRemovedFromMap', sValues);
end

function OnTreasuryChanged(playerID, yield, balance)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; yield: ' .. tostring(yield) .. '; balance: ' .. tostring(balance);
	WriteToLuaLog('Events.TreasuryChanged', sValues);
end

function OnTurnBegin()
	local sValues = '';
	WriteToLuaLog('Events.TurnBegin', sValues);
end

function OnTurnEnd()
	local sValues = '';
	WriteToLuaLog('Events.TurnEnd', sValues);
end

function OnUnitAbilityGained(playerID, unitID, eAbilityType)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; eAbilityType: ' .. tostring(eAbilityType);
	WriteToLuaLog('Events.UnitAbilityGained', sValues);
end

function OnUnitActivate()
	local sValues = '';
	WriteToLuaLog('Events.UnitActivate', sValues);
end

function OnUnitActivityChanged(playerID, unitID, eActivityType)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; eActivityType: ' .. tostring(eActivityType);
	WriteToLuaLog('Events.UnitActivityChanged', sValues);
end

function OnUnitAirlifted()
	local sValues = '';
	WriteToLuaLog('Events.UnitAirlifted', sValues);
end

function OnUnitArtifactChanged(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitArtifactChanged', sValues);
end

function OnUnitCaptured(currentUnitOwner, unitID, owningPlayer, capturingPlayer)
	local sValues = 'currentUnitOwner: ' .. tostring(currentUnitOwner) .. '; unitID: ' .. tostring(unitID) .. '; owningPlayer: ' .. tostring(owningPlayer) .. '; capturingPlayer: ' .. tostring(capturingPlayer);
	WriteToLuaLog('Events.UnitCaptured', sValues);
end

function OnUnitChargesChanged(playerID, unitID, newCharges, oldCharges)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; newCharges: ' .. tostring(newCharges) .. '; oldCharges: ' .. tostring(oldCharges);
	WriteToLuaLog('Events.UnitChargesChanged', sValues);
end

function OnUnitCommandStarted(playerID, unitID, hCommand, iData1)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; hCommand: ' .. tostring(hCommand) .. '; iData1: ' .. tostring(iData1);
	WriteToLuaLog('Events.UnitCommandStarted', sValues);
end

function OnUnitDamageChanged(PlayerID, UnitID, newDamage, prevDamage)
	local sValues = 'PlayerID: ' .. tostring(PlayerID) .. '; UnitID: ' .. tostring(UnitID) .. '; newDamage: ' .. tostring(newDamage) .. '; prevDamage: ' .. tostring(prevDamage);
	WriteToLuaLog('Events.UnitDamageChanged', sValues);
end

function OnUnitEmbarkedStateChanged(playerID, unitID, bEmbarkedState)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; bEmbarkedState: ' .. tostring(bEmbarkedState);
	WriteToLuaLog('Events.UnitEmbarkedStateChanged', sValues);
end

function OnUnitEnterFormation(firstUnitOwner, firstUnitID, secondUnitOwner, secondUnitID)
	local sValues = 'firstUnitOwner: ' .. tostring(firstUnitOwner) .. '; firstUnitID: ' .. tostring(firstUnitID) .. '; secondUnitOwner: ' .. tostring(secondUnitOwner) .. '; secondUnitID: ' .. tostring(secondUnitID);
	WriteToLuaLog('Events.UnitEnterFormation', sValues);
end

function OnUnitExitFormation(firstUnitOwner, firstUnitID, secondUnitOwner, secondUnitID)
	local sValues = 'firstUnitOwner: ' .. tostring(firstUnitOwner) .. '; firstUnitID: ' .. tostring(firstUnitID) .. '; secondUnitOwner: ' .. tostring(secondUnitOwner) .. '; secondUnitID: ' .. tostring(secondUnitID);
	WriteToLuaLog('Events.UnitExitFormation', sValues);
end

-- function OnUnitExperienceChanged()
-- 	local sValues = '';
-- 	WriteToLuaLog('Events.UnitExperienceChanged', sValues);
-- end

function OnUnitFormArmy(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitFormArmy', sValues);
end

function OnUnitFormationChanged()
	local sValues = '';
	WriteToLuaLog('Events.UnitFormationChanged', sValues);
end

function OnUnitFormCorps(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitFormCorps', sValues);
end

function OnUnitFortificationChanged(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitFortificationChanged', sValues);
end

function OnUnitGreatPersonChanged()
	local sValues = '';
	WriteToLuaLog('Events.UnitGreatPersonChanged', sValues);
end

function OnUnitGreatPersonCreated(playerID, unitID, greatPersonClassID, greatPersonIndividualID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; greatPersonClassID: ' .. tostring(greatPersonClassID) .. '; greatPersonIndividualID: ' .. tostring(greatPersonIndividualID);
	WriteToLuaLog('Events.UnitGreatPersonCreated', sValues);
end

function OnUnitKilledInCombat(killedPlayerID, killedUnitID, playerID, unitID)
	local sValues = 'killedPlayerID: ' .. tostring(killedPlayerID) .. '; killedUnitID: ' .. tostring(killedUnitID) .. '; playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitKilledInCombat', sValues);
end

function OnUnitMoveComplete(playerID, unitID, iX, iY)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.UnitMoveComplete', sValues);
end

function OnUnitMoved(playerID, unitID, iX, iY, locallyVisible, stateChange)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; locallyVisible: ' .. tostring(locallyVisible) .. '; stateChange: ' .. tostring(stateChange);
	WriteToLuaLog('Events.UnitMoved', sValues);
end

function OnUnitMovementPointsChanged(playerID, unitID, MovementPoints)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; MovementPoints: ' .. tostring(MovementPoints);
	WriteToLuaLog('Events.UnitMovementPointsChanged', sValues);
end

function OnUnitMovementPointsCleared(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitMovementPointsCleared', sValues);
end

function OnUnitMovementPointsRestored(playerID, unitID, MovementPoints)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; MovementPoints: ' .. tostring(MovementPoints);
	WriteToLuaLog('Events.UnitMovementPointsRestored', sValues);
end

function OnUnitOperationAdded(playerID, unitID, iUnknown, hOperation)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; iUnknown: ' .. tostring(iUnknown) .. '; hOperation: ' .. tostring(hOperation);
	WriteToLuaLog('Events.UnitOperationAdded', sValues);
end

function OnUnitOperationDeactivated(playerID, unitID, hOperation, iData1)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; hOperation: ' .. tostring(hOperation) .. '; iData1: ' .. tostring(iData1);
	WriteToLuaLog('Events.UnitOperationDeactivated', sValues);
end

function OnUnitOperationSegmentComplete(playerID, unitID, hCommand, iData1)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; hCommand: ' .. tostring(hCommand) .. '; iData1: ' .. tostring(iData1);
	WriteToLuaLog('Events.UnitOperationSegmentComplete', sValues);
end

function OnUnitOperationStarted(ownerID, unitID, operationID)
	local sValues = 'ownerID: ' .. tostring(ownerID) .. '; unitID: ' .. tostring(unitID) .. '; operationID: ' .. tostring(operationID);
	WriteToLuaLog('Events.UnitOperationStarted', sValues);
end

function OnUnitOperationsCleared(playerID, unitID, hCommand, iData1)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; hCommand: ' .. tostring(hCommand) .. '; iData1: ' .. tostring(iData1);
	WriteToLuaLog('Events.UnitOperationsCleared', sValues);
end

function OnUnitParadropped()
	local sValues = '';
	WriteToLuaLog('Events.UnitParadropped', sValues);
end

function OnUnitPromoted(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitPromoted', sValues);
end

function OnUnitPromotionAvailable(playerID, unitID, promotionID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; promotionID: ' .. tostring(promotionID);
	WriteToLuaLog('Events.UnitPromotionAvailable', sValues);
end

function OnUnitRemovedFromMap(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitRemovedFromMap', sValues);
end

function OnUnitTeleported(playerID, unitID, iX, iY)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('Events.UnitTeleported', sValues);
end

function OnUnitTradeChanged(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitTradeChanged', sValues);
end

function OnUnitUpgraded(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitUpgraded', sValues);
end

function OnUnitVisibilityChanged(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('Events.UnitVisibilityChanged', sValues);
end

function OnWMDCountChanged(playerID, eWMD)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; eWMD: ' .. tostring(eWMD);
	WriteToLuaLog('Events.WMDCountChanged', sValues);
end

function OnWMDDetonated()
	local sValues = '';
	WriteToLuaLog('Events.WMDDetonated', sValues);
end

function OnWMDFalloutChanged()
	local sValues = '';
	WriteToLuaLog('Events.WMDFalloutChanged', sValues);
end

function OnWMDFalloutVisibilityChanged()
	local sValues = '';
	WriteToLuaLog('Events.WMDFalloutVisibilityChanged', sValues);
end

function OnWonderCompleted(iX, iY, buildingIndex, playerIndex, cityID, iPercentComplete, iUnknown)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; buildingIndex: ' .. tostring(buildingIndex) .. '; playerIndex: ' .. tostring(playerIndex) .. '; cityID: ' .. tostring(cityID) .. '; iPercentComplete: ' .. tostring(iPercentComplete) .. '; iUnknown: ' .. tostring(iUnknown);
	WriteToLuaLog('Events.WonderCompleted', sValues);
end

function OnWorldTextMessage(messageType, delay, iX, iY, text)
	local sValues = 'messageType: ' .. tostring(messageType) .. '; delay: ' .. tostring(delay) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; text: ' .. tostring(text);
	WriteToLuaLog('Events.WorldTextMessage', sValues);
end



--====== GameEvents =================================================================================================================================================


function OnBuildingConstructed(playerID, cityID, buildingID, plotID, bOriginalConstruction)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; buildingID: ' .. tostring(buildingID) .. '; plotID: ' .. tostring(plotID) .. '; bOriginalConstruction: ' .. tostring(bOriginalConstruction);
	WriteToLuaLog('GameEvents.BuildingConstructed', sValues);
end

function OnBuildingPillageStateChanged(playerID, cityID, buildingID, bPillageState)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; buildingID: ' .. tostring(buildingID) .. '; bPillageState: ' .. tostring(bPillageState);
	WriteToLuaLog('GameEvents.BuildingPillageStateChanged', sValues);
end

function OnCityBuilt(playerID, cityID, iX, iY)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; cityID: ' .. tostring(cityID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('GameEvents.CityBuilt', sValues);
end

function OnCityConquered(newPlayerID, oldPlayerID, newCityID, iCityX, iCityY)
	local sValues = 'newPlayerID: ' .. tostring(newPlayerID) .. '; oldPlayerID: ' .. tostring(oldPlayerID) .. '; newCityID: ' .. tostring(newCityID) .. '; iCityX: ' .. tostring(iCityX) .. '; iCityY: ' .. tostring(iCityY);
	WriteToLuaLog('GameEvents.CityConquered', sValues);
end

function OnDiploSurpriseDeclareWar(mainPlayer, opponentPlayer)
	local sValues = 'mainPlayer: ' .. tostring(mainPlayer) .. '; opponentPlayer: ' .. tostring(opponentPlayer);
	WriteToLuaLog('GameEvents.DiploSurpriseDeclareWar', sValues);
end

function OnEventPopupChoice(playerID, tParameters)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; tParameters: ' .. tostring(tParameters);
	WriteToLuaLog('GameEvents.EventPopupChoice', sValues);
end

function OnFoundNewWorld(playerID, Threshold)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; Threshold: ' .. tostring(Threshold);
	WriteToLuaLog('GameEvents.FoundNewWorld', sValues);
end

function OnHasFourCities(playerID, Threshold)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; Threshold: ' .. tostring(Threshold);
	WriteToLuaLog('GameEvents.HasFourCities', sValues);
end

function OnOnCityPopulationChanged(cityOwner, cityID, ChangeAmount)
	local sValues = 'cityOwner: ' .. tostring(cityOwner) .. '; cityID: ' .. tostring(cityID) .. '; ChangeAmount: ' .. tostring(ChangeAmount);
	WriteToLuaLog('GameEvents.OnCityPopulationChanged', sValues);
end

function OnOnCivicCulturevated(iPlayer, eCivic)
	local sValues = 'iPlayer: ' .. tostring(iPlayer) .. '; eCivic: ' .. tostring(eCivic);
	WriteToLuaLog('GameEvents.OnCivicCulturevated', sValues);
end

function OnOnDistrictConstructed(playerID, districtID, iX, iY)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; districtID: ' .. tostring(districtID) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('GameEvents.OnDistrictConstructed', sValues);
end

function OnOnFaithEarned(ePlayer, iFaithAmount)
	local sValues = 'ePlayer: ' .. tostring(ePlayer) .. '; iFaithAmount: ' .. tostring(iFaithAmount);
	WriteToLuaLog('GameEvents.OnFaithEarned', sValues);
end

function OnOnGameTurnStarted(playerID)
	local sValues = 'playerID: ' .. tostring(playerID);
	WriteToLuaLog('GameEvents.OnGameTurnStarted', sValues);
end

function OnOnNewMajorityReligion()
	local sValues = '';
	WriteToLuaLog('GameEvents.OnNewMajorityReligion', sValues);
end

function OnOnPillage(playerID, unitID, bImprovement, buildingType)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID) .. '; bImprovement: ' .. tostring(bImprovement) .. '; buildingType: ' .. tostring(buildingType);
	WriteToLuaLog('GameEvents.OnPillage', sValues);
end

function OnOnPlayerCommandSetObjectState(playerID, tParameters)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; tParameters: ' .. tostring(tParameters);
	WriteToLuaLog('GameEvents.OnPlayerCommandSetObjectState', sValues);
end

function OnOnPlayerGaveInfluenceToken(majorID, minorID, iAmount)
	local sValues = 'majorID: ' .. tostring(majorID) .. '; minorID: ' .. tostring(minorID) .. '; iAmount: ' .. tostring(iAmount);
	WriteToLuaLog('GameEvents.OnPlayerGaveInfluenceToken', sValues);
end

function OnOnRandomEventOccurred(iType, iSeverity, iX, iY, iMitigationLevel)
	local sValues = 'iType: ' .. tostring(iType) .. '; iSeverity: ' .. tostring(iSeverity) .. '; iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY) .. '; iMitigationLevel: ' .. tostring(iMitigationLevel);
	WriteToLuaLog('GameEvents.OnRandomEventOccurred', sValues);
end

function OnOnUnitRetreated(unitOwner, unitID)
	local sValues = 'unitOwner: ' .. tostring(unitOwner) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('GameEvents.OnUnitRetreated', sValues);
end

function OnPlayerTurnStartComplete(playerID)
	local sValues = 'playerID: ' .. tostring(playerID);
	WriteToLuaLog('GameEvents.PlayerTurnStartComplete', sValues);
end

function OnPlayerTurnStarted(playerID)
	local sValues = 'playerID: ' .. tostring(playerID);
	WriteToLuaLog('GameEvents.PlayerTurnStarted', sValues);
end

function OnPlotOwnershipChanged()
	local sValues = '';
	WriteToLuaLog('GameEvents.PlotOwnershipChanged', sValues);
end

function OnPlotPropertyChanged(iX, iY)
	local sValues = 'iX: ' .. tostring(iX) .. '; iY: ' .. tostring(iY);
	WriteToLuaLog('GameEvents.PlotPropertyChanged', sValues);
end

function OnPolicyChanged(playerID, policyID, bEnacted)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; policyID: ' .. tostring(policyID) .. '; bEnacted: ' .. tostring(bEnacted);
	WriteToLuaLog('GameEvents.PolicyChanged', sValues);
end

function OnUnitAddedToMap(playerID, unitID)
	local sValues = 'playerID: ' .. tostring(playerID) .. '; unitID: ' .. tostring(unitID);
	WriteToLuaLog('GameEvents.UnitAddedToMap', sValues);
end




--==================================================================================================================================================================
--========================================================================   INIT & HOOKS   ========================================================================
--==================================================================================================================================================================

function Initialize()
	-- uncomment the Events and GameEvents that should be written to Lua.log

	-- Events.AllianceAvailable.Add(OnAllianceAvailable);
	-- Events.AllianceEnded.Add(OnAllianceEnded);
	-- Events.AnarchyBegins.Add(OnAnarchyBegins);
	-- Events.AnarchyEnds.Add(OnAnarchyEnds);
	-- Events.BarbarianSpottedCity.Add(OnBarbarianSpottedCity);
	-- Events.BeginWonderReveal.Add(OnBeginWonderReveal);
	Events.BeliefAdded.Add(OnBeliefAdded);
	Events.BuildingAddedToMap.Add(OnBuildingAddedToMap);
	Events.BuildingChanged.Add(OnBuildingChanged);
	Events.BuildingRemovedFromMap.Add(OnBuildingRemovedFromMap);
	-- Events.CapitalCityChanged.Add(OnCapitalCityChanged);
	Events.CityAddedToMap.Add(OnCityAddedToMap);
	Events.CityCommandStarted.Add(OnCityCommandStarted);
	-- Events.CityDefenseStatusChanged.Add(OnCityDefenseStatusChanged);
	Events.CityFocusChanged.Add(OnCityFocusChanged);
	Events.CityInitialized.Add(OnCityInitialized);
	Events.CityLiberated.Add(OnCityLiberated);
	Events.CityLoyaltyChanged.Add(OnCityLoyaltyChanged);
	Events.CityMadePurchase.Add(OnCityMadePurchase);
	-- Events.CityNameChanged.Add(OnCityNameChanged);
	-- Events.CityOccupationChanged.Add(OnCityOccupationChanged);
	Events.CityPopulationChanged.Add(OnCityPopulationChanged);
	Events.CityProductionChanged.Add(OnCityProductionChanged);
	Events.CityProductionCompleted.Add(OnCityProductionCompleted);
	Events.CityProductionUpdated.Add(OnCityProductionUpdated);
	Events.CityProjectCompleted.Add(OnCityProjectCompleted);
	Events.CityReligionChanged.Add(OnCityReligionChanged);
	Events.CityReligionFollowersChanged.Add(OnCityReligionFollowersChanged);
	Events.CityRemovedFromMap.Add(OnCityRemovedFromMap);
	-- Events.CitySiegeStatusChanged.Add(OnCitySiegeStatusChanged);
	Events.CityTileOwnershipChanged.Add(OnCityTileOwnershipChanged);
	Events.CityTransfered.Add(OnCityTransfered);
	Events.CityUnitsChanged.Add(OnCityUnitsChanged);
	Events.CityVisibilityChanged.Add(OnCityVisibilityChanged);
	Events.CityWorkerChanged.Add(OnCityWorkerChanged);
	Events.CivicBoostTriggered.Add(OnCivicBoostTriggered);
	Events.CivicChanged.Add(OnCivicChanged);
	Events.CivicCompleted.Add(OnCivicCompleted);
	Events.CivicQueueChanged.Add(OnCivicQueueChanged);
	Events.CivicsUnlocked.Add(OnCivicsUnlocked);
	Events.Combat.Add(OnCombat);
	-- Events.CulturalIdentityCitizenConverted.Add(OnCulturalIdentityCitizenConverted);
	-- Events.CulturalIdentityCityConverted.Add(OnCulturalIdentityCityConverted);
	-- Events.CulturalIdentityConversionOutcomeChanged.Add(OnCulturalIdentityConversionOutcomeChanged);
	Events.CultureChanged.Add(OnCultureChanged);
	Events.CultureYieldChanged.Add(OnCultureYieldChanged);
	Events.DiplomacyDealEnacted.Add(OnDiplomacyDealEnacted);
	Events.DiplomacyDealExpired.Add(OnDiplomacyDealExpired);
	Events.DiplomacyDeclareWar.Add(OnDiplomacyDeclareWar);
	Events.DiplomacyIncomingDeal.Add(OnDiplomacyIncomingDeal);
	-- Events.DiplomacyMakePeace.Add(OnDiplomacyMakePeace);
	Events.DiplomacyMeet.Add(OnDiplomacyMeet);
	Events.DiplomacyMeetMajorMinor.Add(OnDiplomacyMeetMajorMinor);
	Events.DiplomacyMeetMajors.Add(OnDiplomacyMeetMajors);
	-- Events.DiplomacyRefusePeace.Add(OnDiplomacyRefusePeace);
	Events.DiplomacyRelationshipChanged.Add(OnDiplomacyRelationshipChanged);
	Events.DiplomacySessionClosed.Add(OnDiplomacySessionClosed);
	Events.DiplomacyStatement.Add(OnDiplomacyStatement);
	Events.DistrictAddedToMap.Add(OnDistrictAddedToMap);
	Events.DistrictBuildProgressChanged.Add(OnDistrictBuildProgressChanged);
	Events.DistrictCombatChanged.Add(OnDistrictCombatChanged);
	Events.DistrictDamageChanged.Add(OnDistrictDamageChanged);
	Events.DistrictPillaged.Add(OnDistrictPillaged);
	Events.DistrictRemovedFromMap.Add(OnDistrictRemovedFromMap);
	Events.DistrictUnitsChanged.Add(OnDistrictUnitsChanged);
	Events.DistrictVisibilityChanged.Add(OnDistrictVisibilityChanged);
	-- Events.EmergenciesUpdated.Add(OnEmergenciesUpdated);
	-- Events.EmergencyAvailable.Add(OnEmergencyAvailable);
	-- Events.EmergencyAvailableParticipant.Add(OnEmergencyAvailableParticipant);
	-- Events.EmergencyCompleted.Add(OnEmergencyCompleted);
	-- Events.EmergencyCompleteParticipants.Add(OnEmergencyCompleteParticipants);
	-- Events.EmergencyRejected.Add(OnEmergencyRejected);
	-- Events.EmergencyStarted.Add(OnEmergencyStarted);
	-- Events.EndTurnBlockingChanged.Add(OnEndTurnBlockingChanged);
	Events.EndTurnDirty.Add(OnEndTurnDirty);
	Events.EndWonderReveal.Add(OnEndWonderReveal);
	Events.EventPopupRequest.Add(OnEventPopupRequest);
	-- Events.EventSoundRequest.Add(OnEventSoundRequest);
	Events.FaithChanged.Add(OnFaithChanged);
	Events.FeatureAddedToMap.Add(OnFeatureAddedToMap);
	Events.FeatureChanged.Add(OnFeatureChanged);
	Events.FeatureRemovedFromMap.Add(OnFeatureRemovedFromMap);
	Events.GameEraChanged.Add(OnGameEraChanged);
	Events.GameHistoryMomentRecorded.Add(OnGameHistoryMomentRecorded);
	Events.GoodyHutReward.Add(OnGoodyHutReward);
	Events.GovDistrictPolicyLocked.Add(OnGovDistrictPolicyLocked);
	Events.GovDistrictPolicyUnlocked.Add(OnGovDistrictPolicyUnlocked);
	Events.GovernmentChanged.Add(OnGovernmentChanged);
	Events.GovernmentPolicyChanged.Add(OnGovernmentPolicyChanged);
	Events.GovernmentPolicyObsoleted.Add(OnGovernmentPolicyObsoleted);
	Events.GovernorAppointed.Add(OnGovernorAppointed);
	Events.GovernorAssigned.Add(OnGovernorAssigned);
	Events.GovernorChanged.Add(OnGovernorChanged);
	Events.GovernorEstablished.Add(OnGovernorEstablished);
	Events.GovernorPointsChanged.Add(OnGovernorPointsChanged);
	Events.GovernorPromoted.Add(OnGovernorPromoted);
	Events.GreatPeoplePointsChanged.Add(OnGreatPeoplePointsChanged);
	Events.GreatPeopleTimelineChanged.Add(OnGreatPeopleTimelineChanged);
	-- Events.GreatWorkCreated.Add(OnGreatWorkCreated);
	-- Events.GreatWorkMoved.Add(OnGreatWorkMoved);
	Events.ImprovementActivated.Add(OnImprovementActivated);
	Events.ImprovementAddedToMap.Add(OnImprovementAddedToMap);
	Events.ImprovementChanged.Add(OnImprovementChanged);
	Events.ImprovementOwnershipChanged.Add(OnImprovementOwnershipChanged);
	Events.ImprovementRemovedFromMap.Add(OnImprovementRemovedFromMap);
	-- Events.ImprovementVisibilityChanged.Add(OnImprovementVisibilityChanged);
	Events.InfluenceChanged.Add(OnInfluenceChanged);
	Events.InfluenceGiven.Add(OnInfluenceGiven);
	-- Events.LevyCounterChanged.Add(OnLevyCounterChanged);
	Events.LocalPlayerChanged.Add(OnLocalPlayerChanged);
	Events.LocalPlayerTurnBegin.Add(OnLocalPlayerTurnBegin);
	Events.LocalPlayerTurnEnd.Add(OnLocalPlayerTurnEnd);
	Events.LocalPlayerTurnUnready.Add(OnLocalPlayerTurnUnready);
	Events.MapYieldsChanged.Add(OnMapYieldsChanged);
	-- Events.NationalParkAdded.Add(OnNationalParkAdded);
	-- Events.NationalParkRemoved.Add(OnNationalParkRemoved);
	Events.NaturalWonderRevealed.Add(OnNaturalWonderRevealed);
	Events.NotificationActivated.Add(OnNotificationActivated);
	Events.NotificationAdded.Add(OnNotificationAdded);
	Events.NotificationDismissed.Add(OnNotificationDismissed);
	Events.NotificationRefreshRequested.Add(OnNotificationRefreshRequested);
	Events.ObjectPairing.Add(OnObjectPairing);
	-- Events.OnAiAdvisorUpdated.Add(OnOnAiAdvisorUpdated);
	Events.UnitGreatPersonActivated.Add(OnUnitGreatPersonActivated);
	Events.PantheonFounded.Add(OnPantheonFounded);
	Events.PhaseBegin.Add(OnPhaseBegin);
	Events.PhaseEnd.Add(OnPhaseEnd);
	Events.PlayerAgeChanged.Add(OnPlayerAgeChanged);
	Events.PlayerBordersChanged.Add(OnPlayerBordersChanged);
	Events.PlayerDarkAgeChanged.Add(OnPlayerDarkAgeChanged);
	Events.PlayerDefeat.Add(OnPlayerDefeat);
	Events.PlayerDestroyed.Add(OnPlayerDestroyed);
	Events.PlayerEraChanged.Add(OnPlayerEraChanged);
	Events.PlayerEraScoreChanged.Add(OnPlayerEraScoreChanged);
	Events.PlayerEraTransitionBegins.Add(OnPlayerEraTransitionBegins);
	Events.PlayerOperationComplete.Add(OnPlayerOperationComplete);
	Events.PlayerResourceChanged.Add(OnPlayerResourceChanged);
	Events.PlayerRestored.Add(OnPlayerRestored);
	Events.PlayerRevived.Add(OnPlayerRevived);
	Events.PlayerTurnActivated.Add(OnPlayerTurnActivated);
	Events.PlayerTurnDeactivated.Add(OnPlayerTurnDeactivated);
	Events.PlotMarkerChanged.Add(OnPlotMarkerChanged);
	-- Events.PlotVisibilityChanged.Add(OnPlotVisibilityChanged);
	Events.PlotYieldChanged.Add(OnPlotYieldChanged);
	Events.QuestChanged.Add(OnQuestChanged);
	Events.ReligionFounded.Add(OnReligionFounded);
	Events.RemotePlayerTurnBegin.Add(OnRemotePlayerTurnBegin);
	Events.RemotePlayerTurnEnd.Add(OnRemotePlayerTurnEnd);
	Events.RemotePlayerTurnUnready.Add(OnRemotePlayerTurnUnready);
	Events.ResearchChanged.Add(OnResearchChanged);
	Events.ResearchCompleted.Add(OnResearchCompleted);
	Events.ResearchQueueChanged.Add(OnResearchQueueChanged);
	Events.ResearchYieldChanged.Add(OnResearchYieldChanged);
	-- Events.ResourceAddedToMap.Add(OnResourceAddedToMap);
	Events.ResourceChanged.Add(OnResourceChanged);
	Events.ResourceRemovedFromMap.Add(OnResourceRemovedFromMap);
	-- Events.ResourceVisibilityChanged.Add(OnResourceVisibilityChanged);
	Events.RouteAddedToMap.Add(OnRouteAddedToMap);
	Events.RouteChanged.Add(OnRouteChanged);
	Events.RouteRemovedFromMap.Add(OnRouteRemovedFromMap);
	Events.SpyAdded.Add(OnSpyAdded);
	Events.SpyMissionCompleted.Add(OnSpyMissionCompleted);
	Events.SpyMissionUpdated.Add(OnSpyMissionUpdated);
	Events.SpyRemoved.Add(OnSpyRemoved);
	Events.SpyUpdated.Add(OnSpyUpdated);
	Events.StatusMessage.Add(OnStatusMessage);
	Events.SystemUpdateUI.Add(OnSystemUpdateUI);
	-- Events.TeamVictory.Add(OnTeamVictory);
	Events.TechBoostTriggered.Add(OnTechBoostTriggered);
	Events.TerrainTypeChanged.Add(OnTerrainTypeChanged);
	Events.TradeRouteActivityChanged.Add(OnTradeRouteActivityChanged);
	Events.TradeRouteAddedToMap.Add(OnTradeRouteAddedToMap);
	Events.TradeRouteCapacityChanged.Add(OnTradeRouteCapacityChanged);
	Events.TradeRouteRangeChanged.Add(OnTradeRouteRangeChanged);
	Events.TradeRouteRemovedFromMap.Add(OnTradeRouteRemovedFromMap);
	Events.TreasuryChanged.Add(OnTreasuryChanged);
	Events.TurnBegin.Add(OnTurnBegin);
	Events.TurnEnd.Add(OnTurnEnd);
	Events.UnitAbilityGained.Add(OnUnitAbilityGained);
	Events.UnitActivate.Add(OnUnitActivate);
	-- Events.UnitActivityChanged.Add(OnUnitActivityChanged);
	Events.UnitAirlifted.Add(OnUnitAirlifted);
	Events.UnitArtifactChanged.Add(OnUnitArtifactChanged);
	Events.UnitCaptured.Add(OnUnitCaptured);
	-- Events.UnitChargesChanged.Add(OnUnitChargesChanged);
	Events.UnitCommandStarted.Add(OnUnitCommandStarted);
	Events.UnitDamageChanged.Add(OnUnitDamageChanged);
	Events.UnitEmbarkedStateChanged.Add(OnUnitEmbarkedStateChanged);
	-- Events.UnitEnterFormation.Add(OnUnitEnterFormation);
	-- Events.UnitExitFormation.Add(OnUnitExitFormation);
	Events.UnitFormArmy.Add(OnUnitFormArmy);
	Events.UnitFormationChanged.Add(OnUnitFormationChanged);
	Events.UnitFormCorps.Add(OnUnitFormCorps);
	-- Events.UnitFortificationChanged.Add(OnUnitFortificationChanged);
	Events.UnitGreatPersonChanged.Add(OnUnitGreatPersonChanged);
	Events.UnitGreatPersonCreated.Add(OnUnitGreatPersonCreated);
	Events.UnitKilledInCombat.Add(OnUnitKilledInCombat);
	-- Events.UnitMoveComplete.Add(OnUnitMoveComplete);
	-- Events.UnitMoved.Add(OnUnitMoved);
	-- Events.UnitMovementPointsChanged.Add(OnUnitMovementPointsChanged);
	-- Events.UnitMovementPointsCleared.Add(OnUnitMovementPointsCleared);
	-- Events.UnitMovementPointsRestored.Add(OnUnitMovementPointsRestored);
	-- Events.UnitOperationAdded.Add(OnUnitOperationAdded);
	-- Events.UnitOperationDeactivated.Add(OnUnitOperationDeactivated);
	Events.UnitOperationSegmentComplete.Add(OnUnitOperationSegmentComplete);
	-- Events.UnitOperationStarted.Add(OnUnitOperationStarted);
	-- Events.UnitOperationsCleared.Add(OnUnitOperationsCleared);
	Events.UnitParadropped.Add(OnUnitParadropped);
	Events.UnitPromoted.Add(OnUnitPromoted);
	Events.UnitPromotionAvailable.Add(OnUnitPromotionAvailable);
	Events.UnitRemovedFromMap.Add(OnUnitRemovedFromMap);
	Events.UnitTeleported.Add(OnUnitTeleported);
	Events.UnitTradeChanged.Add(OnUnitTradeChanged);
	Events.UnitUpgraded.Add(OnUnitUpgraded);
	Events.UnitVisibilityChanged.Add(OnUnitVisibilityChanged);
	-- Events.WMDCountChanged.Add(OnWMDCountChanged);
	-- Events.WMDDetonated.Add(OnWMDDetonated);
	-- Events.WMDFalloutChanged.Add(OnWMDFalloutChanged);
	-- Events.WMDFalloutVisibilityChanged.Add(OnWMDFalloutVisibilityChanged);
	Events.WonderCompleted.Add(OnWonderCompleted);
	Events.WorldTextMessage.Add(OnWorldTextMessage);

-----------------------------------------------------------------------------------------------------------
-- not working/callable Events (attempt to index a nil value):
-- BarbarianRaidStarted, BuildingBuildProgressChanged, BuildingPillaged, BuildingVisibilityChanged, CacheUpdate, CameraUpdated, CityChanged, CliffAddedToMap, CliffRemovedFromMap, DistrictBuildingRestore, FeatureVisibilityChanged, NationalParkVisibilityChanged, PlayerVictory, PlotAppealChanged, QueueFlushed, RiverAddedToMap, RiverRemovedFromMap, RouteVisibilityChanged, UnitExperienceChanged
-----------------------------------------------------------------------------------------------------------


	GameEvents.BuildingConstructed.Add(OnBuildingConstructed);
	GameEvents.BuildingPillageStateChanged.Add(OnBuildingPillageStateChanged);
	GameEvents.CityBuilt.Add(OnCityBuilt);
	GameEvents.CityConquered.Add(OnCityConquered);
	GameEvents.DiploSurpriseDeclareWar.Add(OnDiploSurpriseDeclareWar);
	GameEvents.EventPopupChoice.Add(OnEventPopupChoice);
	GameEvents.FoundNewWorld.Add(OnFoundNewWorld);
	GameEvents.HasFourCities.Add(OnHasFourCities);
	GameEvents.OnCityPopulationChanged.Add(OnOnCityPopulationChanged);
	GameEvents.OnCivicCulturevated.Add(OnOnCivicCulturevated);
	GameEvents.OnDistrictConstructed.Add(OnOnDistrictConstructed);
	GameEvents.OnFaithEarned.Add(OnOnFaithEarned);
	GameEvents.OnGameTurnStarted.Add(OnOnGameTurnStarted);
	GameEvents.OnNewMajorityReligion.Add(OnOnNewMajorityReligion);
	GameEvents.OnPillage.Add(OnOnPillage);
	GameEvents.OnPlayerCommandSetObjectState.Add(OnOnPlayerCommandSetObjectState);
	GameEvents.OnPlayerGaveInfluenceToken.Add(OnOnPlayerGaveInfluenceToken);
	GameEvents.OnRandomEventOccurred.Add(OnOnRandomEventOccurred);
	GameEvents.OnUnitRetreated.Add(OnOnUnitRetreated);
	GameEvents.PlayerTurnStartComplete.Add(OnPlayerTurnStartComplete);
	GameEvents.PlayerTurnStarted.Add(OnPlayerTurnStarted);
	GameEvents.PlotOwnershipChanged.Add(OnPlotOwnershipChanged);
	-- GameEvents.PlotPropertyChanged.Add(OnPlotPropertyChanged);
	GameEvents.PolicyChanged.Add(OnPolicyChanged);
	GameEvents.UnitAddedToMap.Add(OnUnitAddedToMap);

-----------------------------------------------------------------------------------------------------------
-- not working/callable GameEvents (attempt to index a nil value):
--
-----------------------------------------------------------------------------------------------------------


	-- and finally let Lua.log know that this file has been loaded!
	WriteToLuaLog('LuaEventLogger loaded', '');
end

Initialize();
